//
//  ProductOwnerViewController.m
//  Finance
//
//  Created by cheng xiang on 13-9-22.
//  Copyright (c) 2013年 cheng xiang. All rights reserved.
//

#import "ProductOwnerViewController.h"

@interface ProductOwnerViewController ()

@end

@implementation ProductOwnerViewController
@synthesize pubUserIdLabel = _pubUserIdLabel,shopNameLabel = _shopNameLabel, pubUserNameLabel = _pubUserNameLabel;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
        UIColor* bk = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"beij.png"]];
        [self.view setBackgroundColor:bk];
        
        UIBarButtonItem *leftItem = [[UIBarButtonItem alloc] initWithTitle:@"返回" style:UIBarButtonItemStyleBordered target:self action:@selector(goReturn)];
        [leftItem setBackgroundImage:[UIImage imageNamed:@"btn.png"] forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
        self.navigationItem.leftBarButtonItem = leftItem;
        
        UIImageView *celltextbgView = [[UIImageView alloc] initWithFrame:CGRectMake(5, 20, 310, 40)];
        [celltextbgView setImage:[[UIImage imageNamed:@"celltextbg.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(10, 10, 10, 10)]];
        [self.view addSubview:celltextbgView];
        
        UILabel *title = [[UILabel alloc] initWithFrame:CGRectMake(10, 30, 90, 20)];
        title.text = @"发布用户编号";
        title.font = [UIFont systemFontOfSize:13];
        title.backgroundColor = [UIColor clearColor];
        title.numberOfLines = 0;
        title.lineBreakMode = NSLineBreakByWordWrapping;
        title.textColor = [UIColor colorWithRed:120.0/255 green:12.0/255 blue:9.0/255 alpha:1];
        [self.view addSubview:title];
        
        _pubUserIdLabel = [[UILabel alloc] initWithFrame:CGRectMake(100, 30, 200, 20)];
        _pubUserIdLabel.textAlignment = NSTextAlignmentRight;
        _pubUserIdLabel.font = [UIFont systemFontOfSize:13];
        [_pubUserIdLabel setBackgroundColor:[UIColor clearColor]];
        
        celltextbgView = [[UIImageView alloc] initWithFrame:CGRectMake(5, 70, 310, 40)];
        [celltextbgView setImage:[[UIImage imageNamed:@"celltextbg.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(10, 10, 10, 10)]];
        [self.view addSubview:celltextbgView];
        
        title = [[UILabel alloc] initWithFrame:CGRectMake(10, 80, 120, 20)];
        title.text = @"发布用户店铺名称";
        title.font = [UIFont systemFontOfSize:13];
        title.backgroundColor = [UIColor clearColor];
        title.numberOfLines = 0;
        title.lineBreakMode = NSLineBreakByWordWrapping;
        title.textColor = [UIColor colorWithRed:120.0/255 green:12.0/255 blue:9.0/255 alpha:1];
        [self.view addSubview:title];
        
        _shopNameLabel = [[UILabel alloc] initWithFrame:CGRectMake(130, 80, 170, 20)];
        _shopNameLabel.textAlignment = NSTextAlignmentRight;
        _shopNameLabel.font = [UIFont systemFontOfSize:13];
        [_shopNameLabel setBackgroundColor:[UIColor clearColor]];
        
        celltextbgView = [[UIImageView alloc] initWithFrame:CGRectMake(5, 120, 310, 40)];
        [celltextbgView setImage:[[UIImage imageNamed:@"celltextbg.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(10, 10, 10, 10)]];
        [self.view addSubview:celltextbgView];
        
        title = [[UILabel alloc] initWithFrame:CGRectMake(10, 130, 90, 20)];
        title.text = @"发布用户名称";
        title.font = [UIFont systemFontOfSize:13];
        title.backgroundColor = [UIColor clearColor];
        title.numberOfLines = 0;
        title.lineBreakMode = NSLineBreakByWordWrapping;
        title.textColor = [UIColor colorWithRed:120.0/255 green:12.0/255 blue:9.0/255 alpha:1];
        [self.view addSubview:title];
        
        _pubUserNameLabel = [[UILabel alloc] initWithFrame:CGRectMake(100, 130, 200, 20)];
        _pubUserNameLabel.textAlignment = NSTextAlignmentRight;
        _pubUserNameLabel.font = [UIFont systemFontOfSize:13];
        [_pubUserNameLabel setBackgroundColor:[UIColor clearColor]];
    }
    return self;
}

- (void)goReturn
{
    [self.navigationController popViewControllerAnimated:YES];
}

-(void)drawView:(NSDictionary *)dic
{
    self.proDic = dic;
    [_pubUserNameLabel setText:[self.proDic objectForKey:@"pubUserName"]];
    [_pubUserIdLabel setText:[self.proDic objectForKey:@"pubUserId"]];
    [_shopNameLabel setText:[self.proDic objectForKey:@"shopName"]];
}

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
